import request from '@/utils/request'

// 渲染数据
export function getClients(params) {
  return request({
    url: '/clients',
    params
  })
}

// 增加
export function addClients(data) {
  return request({
    url: '/clients',
    method: 'post',
    data
  })
}

// 经纪人
export function getAgents() {
  return request({
    url: '/agents'
  })
}

// 删除
export function delClients(id) {
  return request({
    url: `/clients/${id}`,
    method: 'delete'
  })
}

// 回显
export function getClientsById(id) {
  return request({
    url: `/clients/${id}`

  })
}

// 编辑
export function updateClientsById(data) {
  return request({
    url: `/clients/${data.id}`,
    method: 'put',
    data

  })
}

// 下拉列表搜索
export function getClientsByName(params) {
  return request({
    url: '/clients',
    params
  })
}
export function getCount(params) {
  return request({
    url: '/clients/count',
    method: 'get',
    params
  })
}
